package demo1;

//抽象类
abstract class Shape {
/*    public void draw() {
        //System.out.println("一个图形");
    }*/
    public abstract void draw();//抽象方法
}
class Cycle extends Shape{
    @Override
    public void draw() {
        System.out.println("⚪");
    }
}
class rhomboid extends Shape{
    @Override
    public void draw() {
        System.out.println("菱形");
    }
}
class triangle extends Shape{
    @Override
    public void draw() {
        System.out.println("三角形");
    }
}

public class Test {
    public static void main(String[] args) {

    }
    public static void main2(String[] args) {
        //Shape shape = new Shape();
    }
    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main1(String[] args) {
        drawMap(new Cycle());
        drawMap(new triangle());
    }
}
